package com.liuguang.picture.controller;

import com.liuguang.api.picture.PictureService;
import com.liuguang.common.pojo.CommonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName: PictureController
 * @Description：
 * @Author: wanghr
 * Date: 4:33 PM 2020/10/22
 * Version: 1.0
 */
@RestController
@RequestMapping("/picture")
public class PictureController {
    private static final Logger logger = LoggerFactory.getLogger(PictureController.class);
    @Autowired
    private PictureService pictureService;

    @RequestMapping("/getUpToken")
    public CommonResult getUpToken() {
        return pictureService.getUpToken();
    }

    @RequestMapping("/upLoadToQiNiu")
    public CommonResult upLoadToQiNiu(HttpServletRequest request) {
        logger.info("开始图片上传七牛云");
        return pictureService.upLoadToQiNiu(request);
    }
}
